package com.example.tsproject.service;

import com.example.tsproject.entity.Assignments;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.tsproject.entity.AssignmentsWithStudentName;
import com.example.tsproject.entity.Questions;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author DELL
* @description 针对表【assignments】的数据库操作Service
* @createDate 2025-03-11 10:52:34
*/
public interface AssignmentsService extends IService<Assignments> {

    List<Assignments> getExerciseList(String publisher_Number);
    List<Assignments> getHomeworkList(String stuNumber);

    List<Assignments> getAssignmentsList(String tNumber);

    List<Assignments> getStuWorkListByClass(String tNumber, String classNumber, String name);

    boolean createAssignmentForStudent(String studentNumber, String name, String assignmentType, List<Questions> questions, Date startTime, Date endTime);

    boolean assignToClass(String type,String name, List<Questions> questions, String stuclass, Date startTime, Date endTime);
    boolean submitAnswers(Integer assignmentId, List<Map<String, Object>> userAnswers);

    void delete(Integer assId);

    List<Assignments> getAllTypeList(@Param("stuNumber") String stuNumber, @Param("type") String type);
    List<Assignments> getTExamsOrAssignmentsList(@Param("tNumber") String tNumber,@Param("type") String type);

    void Tdelete(String classNumber, String name);

    List<AssignmentsWithStudentName> getStuWorkListWithStudentNameByClass(
            @Param("tNumber") String tNumber,
            @Param("classNumber") String classNumber,
            @Param("name") String name
    );

    boolean checknameexist(String name);
}
